--//Azuremyst Isle NOT FINISHED Script//Made by LASP - Justin// Thank you for using our scripts.
--If you find / see any bugs, please report by contacting one of our scripters.
--                           luaprojectleader@hotmail.com

--Blood Elf Bandit
function md_OnCombat(Unit, Event)
Unit:RegisterEvent("md_Spellname", 3000, 0)
Unit:RegisterEvent("md_Spellnamq", 6000, 0)
end

function md_Spellname(pUnit, Event)
pUnit:CastSpellOnTarget(14873, pUnit:GetClosestPlayer()) 
end

function md_Spellnamq(pUnit, Event)
pUnit:CastSpellOnTarget(15691, pUnit:GetClosestPlayer())
end

function md_OnDied(Unit, Event)
Unit:RemoveEvents()
end

function md_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end

RegisterUnitEvent(17591, 1, "md_OnCombat")
RegisterUnitEvent(17591, 2, "md_OnLeaveCombat")
RegisterUnitEvent(17591, 4, "md_OnDied")

--Abberant Owlbeast
function mf_OnCombat(Unit, Event)
Unit:RegisterEvent("mf_Spellname", 12000, 0)
end

function mf_Spellname(pUnit, Event)
pUnit:FullCastSpellOnTarget(31270, pUnit:GetClosestPlayer()) 
end

function mf_OnDied(Unit, Event)
Unit:RemoveEvents()
end

function mf_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end

RegisterUnitEvent(17187, 1, "mf_OnCombat")
RegisterUnitEvent(17187, 2, "mf_OnLeaveCombat")
RegisterUnitEvent(17187, 4, "mf_OnDied")

--Blood Elf Scout
function ml_OnCombat(Unit, Event)
Unit:SendChatMessage(11, 0, "We won't allow you to leave this valley!")
Unit:RegisterEvent("ml_Spellname", 12000, 0)
end

function ml_Spellname(pUnit, Event)
pUnit:CastSpellOnTarget(25602, pUnit:GetRandomPlayer(0))
end

function ml_OnDied(Unit, Event)
Unit:RemoveEvents()
end

function ml_OnKilledTarget(Unit, Event)
end

function ml_OnLeaveCombat(Unit, Event) 
Unit:RemoveEvents()
end

RegisterUnitEvent(16521, 1, "ml_OnCombat")
RegisterUnitEvent(16521, 2, "ml_OnLeaveCombat")
RegisterUnitEvent(16521, 3, "ml_OnKilledTarget")
RegisterUnitEvent(16521, 4, "ml_OnDied")

--Chieftain
function Ch_OnCombat(Unit, Event)
Unit:SendChatMessage(11, 0, "We won't allow you to leave this valley!")
Unit:RegisterEvent("Ch_Spellname", 9000, 0)
Unit:RegisterEvent("Ch_enrage", 16000, 1)
end

function Ch_Spellname(pUnit, Event)
pUnit:CastSpellOnTarget(13446, pUnit:GetClosestPlayer())
end

function Ch_enrage(pUnit, Event)
pUnit:CastSpell(18501) 
end

function Ch_OnDied(Unit, Event)
Unit:RemoveEvents()
end

function Ch_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end

RegisterUnitEvent(17448, 1, "Ch_OnCombat")
RegisterUnitEvent(17448, 2, "Ch_OnLeaveCombat")
RegisterUnitEvent(17448, 4, "Ch_OnDied")

--Hauteur
function mq_OnCombat(Unit, Event)
Unit:RegisterEvent("mq_Spellname", 12000, 1)
Unit:RegisterEvent("mq_enrage", 6000, 1)
end

function mq_Spellname(pUnit, Event)
pUnit:CastSpellOnTarget(8050, pUnit:GetClosestPlayer())
end

function mq_enrage(pUnit, Event)
pUnit:CastSpell(134) 
end

function mq_OnDied(Unit, Event) --F3--
Unit:RemoveEvents()
end

function mq_OnKilledTarget(Unit, Event)
end

function mq_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end

RegisterUnitEvent(17206, 1, "mq_OnCombat")
RegisterUnitEvent(17206, 2, "mq_OnLeaveCombat")
RegisterUnitEvent(17206, 3, "mq_OnKilledTarget")
RegisterUnitEvent(17206, 4, "mq_OnDied")

--Ravager Specimen
function mw_OnCombat(Unit, Event)
Unit:RegisterEvent("mw_Spellname", 4000, 0)
end

function mw_Spellname(pUnit, Event)
pUnit:CastSpellOnTarget(13443, pUnit:GetClosestPlayer())
end

function mw_OnDied(Unit, Event)
Unit:RemoveEvents()
end

function mw_OnKilledTarget(Unit, Event)
end

function mw_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end

RegisterUnitEvent(17199, 1, "mw_OnCombat")
RegisterUnitEvent(17199, 2, "mw_OnLeaveCombat")
RegisterUnitEvent(17199, 3, "mw_OnKilledTarget")
RegisterUnitEvent(17199, 4, "mw_OnDied")